-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pidcontroller] Implement previous state recovery on startup #13003
Conversation
This feature allows the PID controller parameters to be updated and OpenHAB to be restarted without losing the current controller state. This is especially important for systems with a long response time. For example it might take up to a day for an underfloor heating controller to stabilise after losing state and having to build up the integrator value from zero. Signed-off-by: Lenno Nagel <lenno@nagel.ee>
6eed376
to
466f5d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a handy solution!
Can you add a short note to the readme, that you need to enable the inspector items to recover the values? And maybe add a reference to the core documentation how to setup persistence on Items?
|
||
try { | ||
value = getItemValueAsNumber(itemRegistry.getItem(itemName)); | ||
logger.info("Item '{}' value {} recovered by PID controller", itemName, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be debug or trace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Signed-off-by: Lenno Nagel <lenno@nagel.ee>
Signed-off-by: Lenno Nagel <lenno@nagel.ee>
Signed-off-by: Lenno Nagel <lenno@nagel.ee>
Well I fixed everything, but it seems that builds are failing now (and I have a feeling that it's related to the build failures in main). |
Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Cheers! |
…#13003) * [pidcontroller] Implement previous state recovery on startup This feature allows the PID controller parameters to be updated and OpenHAB to be restarted without losing the current controller state. This is especially important for systems with a long response time. For example it might take up to a day for an underfloor heating controller to stabilise after losing state and having to build up the integrator value from zero. Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Change logger.info -> logger.debug Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Change debug Item -> inspector Item in README Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Add documentation regarding state persistence Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Update bundles/org.openhab.automation.pidcontroller/README.md Signed-off-by: Fabian Wolter <github@fabian-wolter.de> * Update bundles/org.openhab.automation.pidcontroller/README.md Signed-off-by: Fabian Wolter <github@fabian-wolter.de> Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
…#13003) * [pidcontroller] Implement previous state recovery on startup This feature allows the PID controller parameters to be updated and OpenHAB to be restarted without losing the current controller state. This is especially important for systems with a long response time. For example it might take up to a day for an underfloor heating controller to stabilise after losing state and having to build up the integrator value from zero. Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Change logger.info -> logger.debug Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Change debug Item -> inspector Item in README Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Add documentation regarding state persistence Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Update bundles/org.openhab.automation.pidcontroller/README.md Signed-off-by: Fabian Wolter <github@fabian-wolter.de> * Update bundles/org.openhab.automation.pidcontroller/README.md Signed-off-by: Fabian Wolter <github@fabian-wolter.de> Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
…#13003) * [pidcontroller] Implement previous state recovery on startup This feature allows the PID controller parameters to be updated and OpenHAB to be restarted without losing the current controller state. This is especially important for systems with a long response time. For example it might take up to a day for an underfloor heating controller to stabilise after losing state and having to build up the integrator value from zero. Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Change logger.info -> logger.debug Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Change debug Item -> inspector Item in README Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Add documentation regarding state persistence Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Update bundles/org.openhab.automation.pidcontroller/README.md Signed-off-by: Fabian Wolter <github@fabian-wolter.de> * Update bundles/org.openhab.automation.pidcontroller/README.md Signed-off-by: Fabian Wolter <github@fabian-wolter.de> Co-authored-by: Fabian Wolter <github@fabian-wolter.de> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
…#13003) * [pidcontroller] Implement previous state recovery on startup This feature allows the PID controller parameters to be updated and OpenHAB to be restarted without losing the current controller state. This is especially important for systems with a long response time. For example it might take up to a day for an underfloor heating controller to stabilise after losing state and having to build up the integrator value from zero. Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Change logger.info -> logger.debug Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Change debug Item -> inspector Item in README Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Add documentation regarding state persistence Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Update bundles/org.openhab.automation.pidcontroller/README.md Signed-off-by: Fabian Wolter <github@fabian-wolter.de> * Update bundles/org.openhab.automation.pidcontroller/README.md Signed-off-by: Fabian Wolter <github@fabian-wolter.de> Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
…#13003) * [pidcontroller] Implement previous state recovery on startup This feature allows the PID controller parameters to be updated and OpenHAB to be restarted without losing the current controller state. This is especially important for systems with a long response time. For example it might take up to a day for an underfloor heating controller to stabilise after losing state and having to build up the integrator value from zero. Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Change logger.info -> logger.debug Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Change debug Item -> inspector Item in README Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Add documentation regarding state persistence Signed-off-by: Lenno Nagel <lenno@nagel.ee> * Update bundles/org.openhab.automation.pidcontroller/README.md Signed-off-by: Fabian Wolter <github@fabian-wolter.de> * Update bundles/org.openhab.automation.pidcontroller/README.md Signed-off-by: Fabian Wolter <github@fabian-wolter.de> Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
This feature allows the PID controller parameters to be updated and OpenHAB to be restarted without losing the current controller state.
This is especially important for systems with a long response time. For example it might take up to a day for an underfloor heating
controller to stabilise after losing state and having to build up the integrator value from zero.
In case the controller instance has configured OpenHAB items for the integral part, derivative part and error inspectors, then we can query the previous value from the persistance layer for these items and restore them during the controller startup.
I have been using this successfully for about 4 months now during the last heating season.